<?php declare(strict_types=1);
/**
 * @author      xianganyall <xianganyall@gmail.com>
 * @copyright   2023-2025 owner
 **/

namespace Srv\Conf\ConfModel;

use Srv\Libs\ConfModel\ConfAbstract;

final class PayAppleConf extends ConfAbstract
{
    public const PREFIX                         = 'PAYAP.';     // 配置前缀[必定点结尾]
    private string $groupName                   = '';           // 分组名
    protected string $logPath                   = '';           // 日志路径
    protected string $notifyUrl                 = '';           // notifyUrl
    protected string $rootCaCerFile             = '';           // 苹果CA根证书 https://www.apple.com/certificateauthority/AppleRootCA-G3.cer
    protected array $subKeyFiles                = [];           // 签名私钥Key文件列表
    protected string $keyId                     = '';           // 私钥Id[每账号最多10个]
    protected string $issId                     = '';           // 颁发者Id[每账号1个]
    protected string $proPassword               = '';           // 生产验证密码
    protected array $proBundleIds               = [];           // 生产包名列表
    protected string $devPassword               = '';           // 开发验证密码
    protected array $devBundleIds               = [];           // 开发包名列表

    /**
     * @param array $confData
     * @param string $groupName
     */
    public function __construct(array $confData, string $groupName)
    {
        $this->init($confData);
        $this->groupName = $groupName;
    }

    /**
     * @return string
     */
    public function getGroupName(): string
    {
        return $this->groupName;
    }

    /**
     * @return string
     */
    public function getLogPath(): string
    {
        return $this->logPath;
    }

    /**
     * @return string
     */
    public function getNotifyUrl(): string
    {
        return $this->notifyUrl;
    }

    /**
     * @return string
     */
    public function getRootCaCerFile(): string
    {
        return $this->rootCaCerFile;
    }

    /**
     * @return array
     */
    public function getSubKeyFiles(): array
    {
        return $this->subKeyFiles;
    }

    /**
     * @return string
     */
    public function getKeyId(): string
    {
        return $this->keyId;
    }

    /**
     * @return string
     */
    public function getIssId(): string
    {
        return $this->issId;
    }

    /**
     * @return string
     */
    public function getProPassword(): string
    {
        return $this->proPassword;
    }

    /**
     * @return array
     */
    public function getProBundleIds(): array
    {
        return $this->proBundleIds;
    }

    /**
     * @return string
     */
    public function getDevPassword(): string
    {
        return $this->devPassword;
    }

    /**
     * @return array
     */
    public function getDevBundleIds(): array
    {
        return $this->devBundleIds;
    }
}